//About.vue
<template>
  <div class="about">
    <h1>This is an about page</h1>
    <button @click="getData()">test axios 请求数据</button>
    <p>这是请求到的数据{{testData.list}}</p>
  </div>
</template>
<script>
import { reactive } from 'vue'
import API from "../pluging/axiosInstance.js"
export default{
    name:'test1',
    setup(){
        //数据
        const testData = reactive({
            list:[]
        });
const id='88'
        //测试请求方法
        const getData = function(){
            API({
                url:'/test',
                method:'post',
                data:{
                start:2,
                limit:5
            },
            }).then((res)=>{
                alert('请求成功!');
                testData.list = res.data.dataList;
            });
        }
        return{
            testData,
            getData,
            id
        }
    }

}
</script>

